advice_list = []
point = 2

#检验长度的函数
def func1(passwd:str,point):
    if len(passwd) <= 8:
        advice_list.append("你的密码长度小于8，请重新设置！")
    else:
        point += 1
    return point

#检验密码的组成元素复杂度
def func2(passwd:str,point):
    kind = [0,0,0,0]
    for i in passwd:
        if i.isupper:
            kind[0] = 1
        elif i.islower:
            kind[1] = 1
        elif i.isdigit:
            kind[2] = 1
        else:
            kind[3] = 1
    if sum(kind) < 3:
        advice_list.append("你的密码必须包含大、小写字母，数字和特殊字符中的至少三种类型")
    else:
        point += 1
    return point

#检验密码字串重复
def func3(passwd:str):
    global point1
    point1 = 0

    for j in range(len(passwd)):
        if passwd.count(passwd[j:j+3]) >= 3:
            advice_list.append["你的密码有长度超过或者等于3的字串重复"]
            break
        else:
            point1 = 1
    return point1

passwd = input("请输入你要验证的密码(长度必须超过8位)：")

point = func1(passwd,point)

point = func2(passwd,point)

point1 = func3(passwd)
if point1 == 1:
    point += 1

print(point,advice_list)
